package mm.card.dao.model;

import java.util.Date;

import mm.card.util.AesUtil;
import mm.card.util.DateUtil;

public class CardShopInfo {

	public CardShopInfo() {
	}

	public CardShopInfo(CardTable7 tb) throws Exception {
		this.id = tb.getId();
		this.shopId = AesUtil.decrypt(tb.getAttribute1());
		this.qrcodeId = AesUtil.decrypt(tb.getAttribute2());
		this.userName = AesUtil.decrypt(tb.getAttribute3());
		this.password = AesUtil.decrypt(tb.getAttribute4());
		this.name = AesUtil.decrypt(tb.getAttribute5());
		this.phone = AesUtil.decrypt(tb.getAttribute6());
		this.provice = AesUtil.decrypt(tb.getAttribute7());
		this.city = AesUtil.decrypt(tb.getAttribute8());
		this.county = AesUtil.decrypt(tb.getAttribute9());
		this.bank = AesUtil.decrypt(tb.getAttribute10());
		this.bankCode = AesUtil.decrypt(tb.getAttribute11());
		this.bankCard = AesUtil.decrypt(tb.getAttribute12());
		this.registTime = DateUtil.str2DateTime(AesUtil.decrypt(tb.getAttribute13()));
		this.pwdErrorCount = Integer.valueOf(AesUtil.decrypt(tb.getAttribute14()));
		this.isLock = Integer.valueOf(AesUtil.decrypt(tb.getAttribute15()));
		this.lastLoginTime = DateUtil.str2DateTime(AesUtil.decrypt(tb.getAttribute16()));
		this.isActive = Integer.valueOf(AesUtil.decrypt(tb.getAttribute17()));
		this.isValid = Integer.valueOf(AesUtil.decrypt(tb.getAttribute18()));
		this.isDelete = Integer.valueOf(AesUtil.decrypt(tb.getAttribute19()));
	}

	public CardTable7 toCardTable7() throws Exception {
		CardTable7 tb = new CardTable7();
		tb.setId(this.id);
		tb.setAttribute1(AesUtil.encrypt(this.shopId));
		tb.setAttribute2(AesUtil.encrypt(this.qrcodeId));
		tb.setAttribute3(AesUtil.encrypt(this.userName));
		tb.setAttribute4(AesUtil.encrypt(this.password));
		tb.setAttribute5(AesUtil.encrypt(this.name));
		tb.setAttribute6(AesUtil.encrypt(this.phone));
		tb.setAttribute7(AesUtil.encrypt(this.provice));
		tb.setAttribute8(AesUtil.encrypt(this.city));
		tb.setAttribute9(AesUtil.encrypt(this.county));
		tb.setAttribute10(AesUtil.encrypt(this.bank));
		tb.setAttribute11(AesUtil.encrypt(this.bankCode));
		tb.setAttribute12(AesUtil.encrypt(this.bankCard));
		tb.setAttribute13(AesUtil.encrypt(DateUtil.dateTime2Str(this.registTime)));
		tb.setAttribute14(AesUtil.encrypt(this.pwdErrorCount.toString()));
		tb.setAttribute15(AesUtil.encrypt(this.isLock.toString()));
		tb.setAttribute16(AesUtil.encrypt(DateUtil.dateTime2Str(this.lastLoginTime)));
		tb.setAttribute17(AesUtil.encrypt(this.isActive.toString()));
		tb.setAttribute18(AesUtil.encrypt(this.isValid.toString()));
		tb.setAttribute19(AesUtil.encrypt(this.isDelete.toString()));
		return tb;
	}

	/**
	 * This field was generated by MyBatis Generator. This field corresponds to
	 * the database column card_shop_info.id
	 *
	 * @mbggenerated
	 */
	private Long id;

	/**
	 * 商铺ID
	 *
	 * @mbggenerated
	 */
	private String shopId;

	/**
	 * 二维码ID
	 *
	 * @mbggenerated
	 */
	private String qrcodeId;

	/**
	 * 用户名
	 *
	 * @mbggenerated
	 */
	private String userName;

	/**
	 * 密码
	 *
	 * @mbggenerated
	 */
	private String password;

	/**
	 * 商铺名
	 *
	 * @mbggenerated
	 */
	private String name;

	/**
	 * 联系方式
	 *
	 * @mbggenerated
	 */
	private String phone;

	/**
	 * 省份
	 *
	 * @mbggenerated
	 */
	private String provice;

	/**
	 * 城市
	 *
	 * @mbggenerated
	 */
	private String city;

	/**
	 * 县区
	 *
	 * @mbggenerated
	 */
	private String county;

	/**
	 * 开户银行名称
	 *
	 * @mbggenerated
	 */
	private String bank;

	/**
	 * 开户银行代码
	 *
	 * @mbggenerated
	 */
	private String bankCode;

	/**
	 * 银行卡号
	 *
	 * @mbggenerated
	 */
	private String bankCard;

	/**
	 * 注册时间
	 *
	 * @mbggenerated
	 */
	private Date registTime;

	/**
	 * 密码错误次数
	 *
	 * @mbggenerated
	 */
	private Integer pwdErrorCount;

	/**
	 * 是否锁定
	 *
	 * @mbggenerated
	 */
	private Integer isLock;

	/**
	 * 最后登录时间
	 *
	 * @mbggenerated
	 */
	private Date lastLoginTime;

	/**
	 * 是否激活
	 *
	 * @mbggenerated
	 */
	private Integer isActive;

	/**
	 * 是否有效
	 *
	 * @mbggenerated
	 */
	private Integer isValid;

	/**
	 * 是否删除
	 *
	 * @mbggenerated
	 */
	private Integer isDelete;

	/**
	 * 获取
	 *
	 * @return id
	 *
	 * @mbggenerated
	 */
	public Long getId() {
		return id;
	}

	/**
	 * 设置
	 *
	 * @param id
	 *
	 * @mbggenerated
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * 获取商铺ID
	 *
	 * @return shopId 商铺ID
	 *
	 * @mbggenerated
	 */
	public String getShopId() {
		return shopId;
	}

	/**
	 * 设置商铺ID
	 *
	 * @param shopId
	 *            商铺ID
	 *
	 * @mbggenerated
	 */
	public void setShopId(String shopId) {
		this.shopId = shopId == null ? null : shopId.trim();
	}

	/**
	 * 获取二维码ID
	 *
	 * @return qrcodeId 二维码ID
	 *
	 * @mbggenerated
	 */
	public String getQrcodeId() {
		return qrcodeId;
	}

	/**
	 * 设置二维码ID
	 *
	 * @param qrcodeId
	 *            二维码ID
	 *
	 * @mbggenerated
	 */
	public void setQrcodeId(String qrcodeId) {
		this.qrcodeId = qrcodeId == null ? null : qrcodeId.trim();
	}

	/**
	 * 获取用户名
	 *
	 * @return userName 用户名
	 *
	 * @mbggenerated
	 */
	public String getUserName() {
		return userName;
	}

	/**
	 * 设置用户名
	 *
	 * @param userName
	 *            用户名
	 *
	 * @mbggenerated
	 */
	public void setUserName(String userName) {
		this.userName = userName == null ? null : userName.trim();
	}

	/**
	 * 获取密码
	 *
	 * @return password 密码
	 *
	 * @mbggenerated
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * 设置密码
	 *
	 * @param password
	 *            密码
	 *
	 * @mbggenerated
	 */
	public void setPassword(String password) {
		this.password = password == null ? null : password.trim();
	}

	/**
	 * 获取商铺名
	 *
	 * @return name 商铺名
	 *
	 * @mbggenerated
	 */
	public String getName() {
		return name;
	}

	/**
	 * 设置商铺名
	 *
	 * @param name
	 *            商铺名
	 *
	 * @mbggenerated
	 */
	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}

	/**
	 * 获取联系方式
	 *
	 * @return phone 联系方式
	 *
	 * @mbggenerated
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * 设置联系方式
	 *
	 * @param phone
	 *            联系方式
	 *
	 * @mbggenerated
	 */
	public void setPhone(String phone) {
		this.phone = phone == null ? null : phone.trim();
	}

	/**
	 * 获取省份
	 *
	 * @return provice 省份
	 *
	 * @mbggenerated
	 */
	public String getProvice() {
		return provice;
	}

	/**
	 * 设置省份
	 *
	 * @param provice
	 *            省份
	 *
	 * @mbggenerated
	 */
	public void setProvice(String provice) {
		this.provice = provice == null ? null : provice.trim();
	}

	/**
	 * 获取城市
	 *
	 * @return city 城市
	 *
	 * @mbggenerated
	 */
	public String getCity() {
		return city;
	}

	/**
	 * 设置城市
	 *
	 * @param city
	 *            城市
	 *
	 * @mbggenerated
	 */
	public void setCity(String city) {
		this.city = city == null ? null : city.trim();
	}

	/**
	 * 获取县区
	 *
	 * @return county 县区
	 *
	 * @mbggenerated
	 */
	public String getCounty() {
		return county;
	}

	/**
	 * 设置县区
	 *
	 * @param county
	 *            县区
	 *
	 * @mbggenerated
	 */
	public void setCounty(String county) {
		this.county = county == null ? null : county.trim();
	}

	/**
	 * 获取开户银行名称
	 *
	 * @return bank 开户银行名称
	 *
	 * @mbggenerated
	 */
	public String getBank() {
		return bank;
	}

	/**
	 * 设置开户银行名称
	 *
	 * @param bank
	 *            开户银行名称
	 *
	 * @mbggenerated
	 */
	public void setBank(String bank) {
		this.bank = bank == null ? null : bank.trim();
	}

	/**
	 * 获取开户银行代码
	 *
	 * @return bankCode 开户银行代码
	 *
	 * @mbggenerated
	 */
	public String getBankCode() {
		return bankCode;
	}

	/**
	 * 设置开户银行代码
	 *
	 * @param bankCode
	 *            开户银行代码
	 *
	 * @mbggenerated
	 */
	public void setBankCode(String bankCode) {
		this.bankCode = bankCode == null ? null : bankCode.trim();
	}

	/**
	 * 获取银行卡号
	 *
	 * @return bankCard 银行卡号
	 *
	 * @mbggenerated
	 */
	public String getBankCard() {
		return bankCard;
	}

	/**
	 * 设置银行卡号
	 *
	 * @param bankCard
	 *            银行卡号
	 *
	 * @mbggenerated
	 */
	public void setBankCard(String bankCard) {
		this.bankCard = bankCard == null ? null : bankCard.trim();
	}

	/**
	 * 获取注册时间
	 *
	 * @return registTime 注册时间
	 *
	 * @mbggenerated
	 */
	public Date getRegistTime() {
		return registTime;
	}

	/**
	 * 设置注册时间
	 *
	 * @param registTime
	 *            注册时间
	 *
	 * @mbggenerated
	 */
	public void setRegistTime(Date registTime) {
		this.registTime = registTime;
	}

	/**
	 * 获取密码错误次数
	 *
	 * @return pwdErrorCount 密码错误次数
	 *
	 * @mbggenerated
	 */
	public Integer getPwdErrorCount() {
		return pwdErrorCount;
	}

	/**
	 * 设置密码错误次数
	 *
	 * @param pwdErrorCount
	 *            密码错误次数
	 *
	 * @mbggenerated
	 */
	public void setPwdErrorCount(Integer pwdErrorCount) {
		this.pwdErrorCount = pwdErrorCount;
	}

	/**
	 * 获取是否锁定
	 *
	 * @return isLock 是否锁定
	 *
	 * @mbggenerated
	 */
	public Integer getIsLock() {
		return isLock;
	}

	/**
	 * 设置是否锁定
	 *
	 * @param isLock
	 *            是否锁定
	 *
	 * @mbggenerated
	 */
	public void setIsLock(Integer isLock) {
		this.isLock = isLock;
	}

	/**
	 * 获取最后登录时间
	 *
	 * @return lastLoginTime 最后登录时间
	 *
	 * @mbggenerated
	 */
	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	/**
	 * 设置最后登录时间
	 *
	 * @param lastLoginTime
	 *            最后登录时间
	 *
	 * @mbggenerated
	 */
	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	/**
	 * 获取是否激活
	 *
	 * @return isActive 是否激活
	 *
	 * @mbggenerated
	 */
	public Integer getIsActive() {
		return isActive;
	}

	/**
	 * 设置是否激活
	 *
	 * @param isActive
	 *            是否激活
	 *
	 * @mbggenerated
	 */
	public void setIsActive(Integer isActive) {
		this.isActive = isActive;
	}

	/**
	 * 获取是否有效
	 *
	 * @return isValid 是否有效
	 *
	 * @mbggenerated
	 */
	public Integer getIsValid() {
		return isValid;
	}

	/**
	 * 设置是否有效
	 *
	 * @param isValid
	 *            是否有效
	 *
	 * @mbggenerated
	 */
	public void setIsValid(Integer isValid) {
		this.isValid = isValid;
	}

	/**
	 * 获取是否删除
	 *
	 * @return isDelete 是否删除
	 *
	 * @mbggenerated
	 */
	public Integer getIsDelete() {
		return isDelete;
	}

	/**
	 * 设置是否删除
	 *
	 * @param isDelete
	 *            是否删除
	 *
	 * @mbggenerated
	 */
	public void setIsDelete(Integer isDelete) {
		this.isDelete = isDelete;
	}
}